<%@page import="com.user.entity.Manager"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>学校在线考试系统后台管理</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.css" rel="stylesheet">
	<link href="css/bootstrap-table.css" rel="stylesheet">
	<link href="css/bootstrap-select.min.css" rel="stylesheet">
	<link href="css/mystyle.css" rel="stylesheet">
	<link href="css/mgr-style.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link href="css/font-awesome.min.css" rel="stylesheet">
<%!Manager manager = new Manager(); %>
<%if(session.getAttribute("manager")==null){
	response.sendRedirect("mgr_login");
} else{
	manager = (Manager)session.getAttribute("manager");
}%>
  </head>
  <body>
	<nav class="navbar navbar-default" role="navigation">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
						data-target="#example-navbar-collapse">
					<span class="sr-only">切换导航</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<div class="navbar-brand">学校在线考试系统后台管理</div>
			</div>
			<div class="collapse navbar-collapse" id="example-navbar-collapse">
				<ul class="nav navbar-nav  navbar-right">
		            <li class="dropdown">
		                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
		                   	 <i class="fa fa-cog"></i>&nbsp;管理员：<%=manager.getUsername() %><span></span><b class="caret"></b>
		                </a>
		                <ul class="dropdown-menu">
		                    <li><a href="/exam/mgr_updatePwd">修改密码</a></li>
		                    <li><a href="/exam/manager/logout">注销</a></li>
		                </ul>
		            </li>
		        </ul>
			</div>
	</nav>
		<div class="col-sm-2">
			<p class="list-group">
				<a href="/exam/mgr_student" class="list-group-item">学生信息</a>
			    <a href="/exam/mgr_teacher" class="list-group-item _active">教师信息</a>
			    <a href="/exam/mgr_subject" class="list-group-item">科目</a>
			    <a href="/exam/mgr_course" class="list-group-item">课程</a>
			    <a href="/exam/mgr_dept" class="list-group-item">院系</a>
			</p>
		</div>
		
		<div class="col-sm-9">
		
			<div class="panel panel-default">
			    <div class="panel-heading">
					<h4>
						<font class="fa fa-vcard-o">&nbsp;教师信息</font>
					</h4>
			    </div>
			    <div class="panel-body">
					<table class="table table-striped" id="teacherList"></table>
			    </div>
			</div>
		
				<div id="toolbar" class="btn-group form-inline">
					<div class="form-group">
			            <button class="btn btn-primary" data-toggle="modal" data-target="#myModal" style="">
							<span class="fa fa-plus"></span>&nbsp;新增
						</button>
					</div>
					<div class="form-group" style="margin-left:50px;">
						<select required name="deptId" id="search_dept" class="selectpicker" data-live-search="true"></select>
						<select required name=subjId id="search_subject" class="selectpicker" data-live-search="true"></select>
						<input type="text" placeholder="输入教工号/姓名" class="form-control" name="search">
						 <button class="btn btn-primary" onclick="search()">
							<span class="fa fa-search"></span>&nbsp;查找
						</button>
						<button class="btn btn-default" onclick="resetSearch()">
							<span class="fa fa-remove"></span>&nbsp;清空
						</button>
					</div>
		        </div>
				
				<!-- 模态框（Modal） -->
				<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
								<h4 class="modal-title" id="myModalLabel">录入教师信息</h4>
							</div>
							<div class="modal-body">
								<form id="form1" class="form-horizontal" role="form" action="" method="post">
									<input type="hidden" name="id">
									<input type="hidden" name="revoked" value="false">
									<div class="form-group">
										<label for="name" class="col-sm-2 control-label">教工号</label>
										<div class="col-sm-10">
											<input onkeyup="buildPwd(this)" type="text" class="form-control" name="num" required placeholder="教工号">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">姓名</label>
										<div class="col-sm-10">
											<input type="text" class="form-control" name="name" required="required" placeholder="姓名">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">性别</label>
										<div class="col-sm-10">
											<label class="radio-inline"><input type="radio" name="sex" required value="男">男</label>
											<label class="radio-inline"><input type="radio" name="sex" value="女">女</label>
										</div>
									</div>
									
									<div class="form-group">
										<label class="col-sm-2 control-label">院系</label>
										<div class="col-sm-10">
											 <select required name="deptId" id="sele_dept" class="selectpicker" data-live-search="true"></select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">任教科目</label>
										<div class="col-sm-10" id="subjectList">
										    
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label">密码</label>
										<div class="col-sm-10">
											<input class="form-control" required name="password" type="text" placeholder="输入密码">
										</div>
									</div>
									
									<button type="submit" class="btn btn-success" value="Submit">提交</button>
									<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								</form>
								
							</div>
						</div><!-- /.modal-content -->
					</div><!-- /.modal -->
				</div>
		</div>
		
		<!-- 弹出模态框 -->
		<!-- <div id="ycf-alert" class="modal">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h5 class="modal-title"><i class="fa fa-exclamation-circle"></i> [Title]</h5>
                    </div>
                    <div class="modal-body small">
                        <p>[Message]</p>
                    </div>
                    <div class="modal-footer" >
                        <button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>
                        <button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>
                    </div>
                </div>
            </div>
        </div> -->
		
		
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="js/jquery-1.12.4.js"></script>
    <script src="js/jquery-form.js" type="text/javascript"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.min.js"></script>
	<script src="js/bootstrap-table.js"></script>
	<script src="js/bootstrap-table-zh-CN.js"></script>
	
	<script src="js/mgr/TeacherController.js"></script>
  </body>
</html>